package com.zhang.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhang.system.entity.Role;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author 战神
 * @since 2023-07-02
 */
@TableName("sys_admin_user")
@Data
public class AdminUser implements Serializable {

    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "用户名不能为空")
    private String userName;

    private String nickname;

    @NotBlank(message = "密码不能为空")
    private String password;

    private String email;

    private String phone;

    private Integer state;

    private Long avatar;

    private Integer gender;

    private String md5Salt;

    private String createTime;

    private String CreateBy;

    private String lastLoginTime;

    /*视图*/
    @TableField(exist = false)
    private List<Long> roleIds;
    @TableField(exist = false)
    private String genderInfo;
    @TableField(exist = false)
    private List<Role> rolesInfo;

}
